<table>
    <thead>
        <tr>
        	<th nowrap><g:message code="default.edit.label" default="Action" args="['']"/></th>
            <th nowrap><g:message code="moc.tc.id.label" default="Id" /></th>
            <th nowrap><g:message code="moc.tb.tb001.label" default="Tb001" /></th>
        	<th nowrap><g:message code="moc.tc.tc003.label" default="Tc003" /></th>
        	<th nowrap><g:message code="moc.tc.tc004.label" default="Tc004" /></th>
        	<th nowrap><g:message code="moc.tc.tc001.label" default="Tc001" /></th>
        	<th nowrap><g:message code="moc.tc.tc002.label" default="Tc002" /></th>
        	<th nowrap><g:message code="moc.tc.tc005.label" default="Tc005" /></th>
        	<th nowrap><g:message code="moc.tc.tc017.label" default="Tc017" /></th>
        	<th nowrap><g:message code="moc.tc.tc018.label" default="Tc018" /></th>
        	<th nowrap><g:message code="moc.tc.tc010.label" default="Tc010" /></th>
        	<th nowrap><g:message code="moc.tc.tc011.label" default="Tc011" /></th>
        	<th nowrap><g:message code="moc.tc.tc012.label" default="Tc012" /></th>
        	<th nowrap><g:message code="moc.tc.tc013.label" default="Tc013" /></th>
        	<th nowrap><g:message code="moc.tc.tc020.label" default="Tc020" /></th>
            <th nowrap><g:message code="moc.tc.owner.label" default="Owner" /></th>
        </tr>
    </thead>
    <tbody>
    <g:each in="${tcInstanceList}" status="i" var="tcInstance">
        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
            <td><g:link controller="tc" action="edit" id="${tcInstance.id}"><g:message code="default.edit.label" default="Edit" args="['']"/></g:link></td>
            <td><g:link controller="tc" action="show" id="${tcInstance.id}">${fieldValue(bean: tcInstance, field: "id")}</g:link></td>
            <td>${fieldValue(bean: tcInstance, field: "tb.tb001")}</td>
            <td><g:formatDate format="yyyy-MM-dd HH:mm" date="${tcInstance?.tc003}" /></td>
            <td><g:formatDate format="yyyy-MM-dd HH:mm" date="${tcInstance?.tc004}" /></td>
            <td>${fieldValue(bean: tcInstance, field: "tc001")}</td>
            <td>${fieldValue(bean: tcInstance, field: "tc002")}</td>
            <td>${fieldValue(bean: tcInstance, field: "tc005")}</td>
        	<td>${tcInstance?.ti?tcInstance?.tc017 : tcInstance?.tc016}</td>
        	<td>${formatNumber(number : tcInstance.tgs*.tg003.sum(), format: '###,##0.000000')}</td>
        	<td>${formatNumber(number : tcInstance.tc005 + tcInstance.tgs*.tg003.sum(), format: '###,##0.000000')}</td>
        	<td>${formatNumber(number : tcInstance.tc002 * (tcInstance?.ti?tcInstance?.tc017 : tcInstance?.tc016), format: '###,##0.000000')}</td>
        	<td>${formatNumber(number : tcInstance.tc002 * (tcInstance?.ti?tcInstance?.tc017 : tcInstance?.tc016)/tcInstance?.tc005, format: '###,##0.00%')}</td>
        	<td>${formatNumber(number : tcInstance.tc002 * (tcInstance?.ti?tcInstance?.tc017 : tcInstance?.tc016)/(tcInstance?.tc005 + tcInstance.tgs*.tg003.sum()  ), format: '###,##0.00%')}</td>
        	<td>${fieldValue(bean: tcInstance, field: "tc020")}</td>
            <td>${fieldValue(bean: tcInstance, field: "owner.username")}</td>
        </tr>
    </g:each>
    </tbody>
</table>
